package org.linlinjava.litemall.wx.service;

import org.linlinjava.litemall.db.service.CouponAssignService;
import org.linlinjava.litemall.db.util.BenefitEventConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RegisterEvent {

    @Autowired
    private WxBenefitService wxBenefitService;

    @Autowired
    private CouponAssignService couponAssignService;
    /**
     * 统一调度用户注册后的一些逻辑处理
     * @param pid
     * @param uid
     */
    public void exec(Integer uid, Integer pid) {
//        // 记录推荐
//        if (pid != null) {
//            wxBenefitService.share(pid, uid, BenefitEventConstant.SHARE_LOGIN);
//        }
        // 新用户发送注册优惠券
        couponAssignService.assignForRegister(uid);
    }
}
